<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopOrganizationManageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_organization_manage', function (Blueprint $table) {
            $table->id();
            $table->string('name')->default('')->comment('组织名称');
            $table->tinyInteger('type')->default(1)->comment('组织类型 1 总部 2 分公司');
            $table->unsignedBigInteger('developUid')->default(0)->comment('开发负责人id');
            $table->string('developName')->default('')->comment('开发负责人名字');
            $table->unsignedBigInteger('preparationUid')->default(0)->comment('筹备负责人Uid');
            $table->string('preparationName')->default('')->comment('筹备负责人名字');
            $table->tinyInteger('status')->default(0)->comment('状态 0正常 1 禁止 2 其他');
            $table->tinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1是');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '(开店组织管理表)';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_organization_manage');
    }
}
